-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32822][SQL] Change the number of partitions to zero when a range is empty with WholeStageCodegen disabled or falled back #29681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| overflow = true | ||
| if (isEmptyRange) { | ||
| new EmptyRDD[InternalRow](sqlContext.sparkContext) | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: There are no changes within this else block.
The actual change is if block above.
| } | ||
|
|
||
| test("Change the number of partitions to zero when a range is empty") { | ||
| withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. nit: Just in case, could you test both cases with/without whole-stage codegen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right.
| } | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert the unnecesary changes.
maropu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for the minor comments.
|
Test build #128403 has finished for PR 29681 at commit
|
|
Test build #128406 has finished for PR 29681 at commit
|
|
Looks good to me. |
| } | ||
|
|
||
| test("Change the number of partitions to zero when a range is empty") { | ||
| withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use testWithWholeStageCodegenOnAndOff instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't notice I can use it. Thanks.
|
Test build #128510 has finished for PR 29681 at commit
|
|
Thanks! Merged to master. |
What changes were proposed in this pull request?
This PR changes the behavior of RangeExec with WholeStageCodegen disabled or falled back to change the number of partitions to zero when a range is empty.
In the current master, if WholeStageCodegen effects, the number of partitions of an empty range will be changed to zero.
But it doesn't if WholeStageCodegen is disabled or falled back.
Why are the changes needed?
To archive better performance even though WholeStageCodegen disabled or falled back.
Does this PR introduce any user-facing change?
Yes. the number of partitions gotten with
getNumPartitionsfor an empty range will be changed when WholeStageCodegen is disabled.How was this patch tested?
New test.